package com.example.mobile2021606176mhq0615;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private RecyclerView rvMaintUsers;
    private List<Users> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

        list = new MyDataAdapter().QueryAll(this);

        rvMaintUsers.setAdapter(new UsersRViewAdapter(list));
    }

    private void initView() {
        rvMaintUsers = (RecyclerView) findViewById(R.id.rvMaintUsers);

        rvMaintUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}